export function getUrlParams(key: string) {
  const query = window.location.search.substring(1)
  const vars = query.split('&')
  for (let i = 0; i < vars.length; i++) {
    const pair = vars[i].split('=')
    if (pair[0] == key) return pair[1]
  }
  return false
}
export function getUrlParamsKey(key: string) {
  const hash = window.location.hash.substring(1) // 去除 '#' 符号
  const queryIndex = hash.indexOf('?')
  if (queryIndex !== -1 && queryIndex < hash.length - 1) {
    const queryString = hash.substring(queryIndex + 1)
    const params = new URLSearchParams(queryString)

    return params.get(key)
  }
  return null
}
